﻿@model Telerik.Web.Mvc.GridModel<PictureLinkCollectionModel>
@using Telerik.Web.Mvc.UI

@{
    var gridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSize;

    //page title
    ViewBag.Title = @T("Admin.Media.PictureLink.Collection.ListPictureLinkCollections").Text;
}
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/subsites/Administration/Content/images/ico-catalog.png")" />
        @T("Admin.Media.PictureLink.Collection.ListPictureLinkCollections")
    </div>
    <div class="options">
        <a href="@Url.Action("CreatePictureLinkCollection")" class="t-button">@T("Admin.Common.AddNew")</a>
        <a href="@Url.Action("ExportXml")" class="t-button">@T("Admin.Common.ExportToXml")</a>
    </div>
</div>
<table class="adminContent">
    <tr>
        <td>
            @(Html.Telerik().Grid<PictureLinkCollectionModel>(Model.Data)
                    .Name("picturelinkcollections-grid")
                    .Columns(columns =>
                    {
                        columns.Bound(x => x.SystemName).Width(300);
                        columns.Bound(x => x.PictureDisplayType)
                            .Width(50)
                            .Template(x => x.PictureDisplayType.ToString().ToLower())
                            .Centered();
                        columns.Bound(x => x.RelatedContentCategory)
                            .Width(100)
                            .Centered();
                        columns.Bound(x => x.RelatedContentId)
                            .Width(50)
                            .Template(x => x.RelatedContentId.ToString().ToLower())
                            .Centered();
                        columns.Bound(x => x.Id)
                            .Width(50)
                            .Centered()
                            .Template(x => Html.ActionLink(T("Admin.Common.Edit").Text, "EditPictureLinkCollection", new { id = x.Id }))
                            .ClientTemplate("<a href=\"EditPictureLinkCollection/<#= Id #>\">" + T("Admin.Common.Edit").Text + "</a>")
                            .Title(T("Admin.Common.Edit").Text);
                    })
                    .Pageable(settings => settings.Total(Model.Total).PageSize(gridPageSize).Position(GridPagerPosition.Both))
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("ListPictureLinkCollections", "Media"))
                    .EnableCustomBinding(true))
        </td>
    </tr>
</table>